package org.example.wikwok.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.example.wikwok.pojo.Collect;
import org.springframework.stereotype.Repository;

@Repository
public interface CollectMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Collect record);

    int insertSelective(Collect record);

    Collect selectByPrimaryKey(Integer id);



    int updateByPrimaryKeySelective(Collect record);

    int updateByPrimaryKey(Collect record);

    @Select("select count(*) from collect where videoId = #{videoId}")
    int selectCountByVideoId(int videoId);
    @Delete("delete from collect where userId = #{collectorId} and videoId = #{id}")
    void deleteByCollectorIdAndVideoId(int collectorId, int id);

    @Delete("delete from collect where videoId = #{videoId}")
    void deleteByVideoId(int videoId);
}